﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Utils;
using Utils.DatabaseUtils;
using System.Data;

namespace DCSLibrary
{
    public class FooterContactUI
    {
        private const String CACHE_KEY = "FAQ_GetAll";

        public int Add(String Contact, String Position, String Lang)
        {
            try
            {
                return SqlHelper.ExecuteNonQuery(Common.Conn, "FooterContact_add", Contact,  Position,  Lang);
            }
            catch (Exception ex)
            {
                return -1;
            }
        }

        public int Update(int FooterContactID, String Contact, String Position, String Lang)
        {
            try
            {
                return SqlHelper.ExecuteNonQuery(Common.Conn, "FooterContact_update", FooterContactID, Contact, Position, Lang);
            }
            catch (Exception ex)
            {
                return -1;
            }
        }

        public DataSet GetAll()
        {
            try
            {
                return SqlHelper.ExecuteDataset(Common.Conn, CommandType.StoredProcedure, "FooterContact_getall");
            }
            catch (Exception e)
            {
                return null;
            }
        }

        public DataSet GetByID(int FooterContactID)
        {
            try
            {
                return SqlHelper.ExecuteDataset(Common.Conn, "FooterContact_get", FooterContactID);
            }
            catch (Exception e)
            {
                return null;
            }
        }

        public int DeleteByID(int FooterContactID)
        {
            try
            {
                return SqlHelper.ExecuteNonQuery(Common.Conn, "FooterContact_delete", FooterContactID);
            }
            catch (Exception e)
            {
                return -1;
            }
        }
    }
}
